// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   BNImpl.java

package com.sunwayhorizo.health.hl7.datatypes.common;

import com.sunwayhorizo.health.hl7.datatypes.ANY;
import com.sunwayhorizo.health.hl7.datatypes.BL;
import com.sunwayhorizo.health.hl7.datatypes.BN;
import com.sunwayhorizo.health.hl7.datatypes.TYPE;


// Referenced classes of package oracle.apps.ctb.hl7.types.common:
//            BLCommonImpl, BLImpl, TYPEImpl

public class BNImpl extends BLCommonImpl
    implements BN
{

    public static final String RCS_ID = "$Header: BNImpl.java 115.10 2005/07/13 15:04:16 pkiran noship $";
    public static BNImpl TRUE = new BNImpl(true);
    public static BNImpl FALSE = new BNImpl(false);

    public static BN valueOf(boolean flag)
    {
        if(flag)
            return TRUE;
        else
            return FALSE;
    }

    public static BN valueOf(String s)
    {
        if(BLCommonImpl.toBoolean(s))
            return TRUE;
        else
            return FALSE;
    }

    protected BNImpl(boolean flag)
    {
        super(flag);
    }

    public TYPE dataType()
    {
        return com.sunwayhorizo.health.hl7.datatypes.common.TYPEImpl.BN;
    }

    public BL equal(ANY any)
    {
        if(!(any instanceof BN))
        {
            return BLImpl.FALSE;
        } else
        {
            BN bn = (BN)any;
            return BLImpl.valueOf(isTrue() == bn.isTrue());
        }
    }

    public boolean booleanValue()
    {
        return _value;
    }

    public int hashCode()
    {
        int i = 17;
        i += _value ? 1 : 0;
        return i;
    }

}
